package com.fjnldx.mes.controller.productionPlanManagement;

import com.fjnldx.mes.domain.domainReq.*;
import com.fjnldx.mes.domain.domainRes.ModifyDailyPlanLtRes;
import com.fjnldx.mes.domain.domainRes.ModifyDailyPlanQfRes;
import com.fjnldx.mes.domain.domainRes.ModifyDailyPlanRes;
import com.fjnldx.mes.domain.domainRes.Result;
import com.fjnldx.mes.domain.pojo.DevSnAndStatus;
import com.fjnldx.mes.service.productionPlanManagement.ProductionPlanManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping(value ="/dailyPlan")
@Api(value = "生产计划管理", tags = "生产计划管理模块")
public class ProductionPlanManagementController {

    @Resource
    private ProductionPlanManagementService productionPlanManagementService;

    @PostMapping("/queryDevSnAndStatusXs")
    @ApiOperation(value = "日计划-查询机台的可用状态（细纱、粗纱、络筒、并条、梳棉、开棉、抓棉、多仓）--", notes = "Api")
    private Result queryDevSnAndStatus(@RequestBody DevSnAndStatus data){
        return productionPlanManagementService.queryDevSnAndStatus(data);
    }

    @PostMapping("/queryDailyPlan")
    @ApiOperation(value = "查询日计划--", notes = "Api")
    private Result queryDailyPlan(@RequestBody QueryDevSnAndStatusReq queryDailyPlanXsReq ){
        return productionPlanManagementService.queryDailyPlan(queryDailyPlanXsReq);
    }

    @PostMapping("/modifyDailyPlan")
    @ApiOperation(value = "修改日计划--", notes = "修改日计划")
    private Result modifyDailyPlan(@RequestBody ModifyDailyPlanRes data){
        return productionPlanManagementService.modifyDailyPlan(data);
    }

    @PostMapping("/modifyDailyPlanLt")
    @ApiOperation(value = "修改日计划络筒--", notes = "修改日计划络筒")
    private Result modifyDailyPlanLt(@RequestBody ModifyDailyPlanLtRes data){
        return productionPlanManagementService.modifyDailyPlanLt(data);
    }

    @PostMapping("/modifyDailyPlanQf")
    @ApiOperation(value = "修改日计划前纺--", notes = "修改日计划前纺")
    private Result modifyDailyPlanQf(@RequestBody ModifyDailyPlanQfRes data){
        return productionPlanManagementService.modifyDailyPlanQf(data);
    }

    @PostMapping("/deleteDailyPlan")
    @ApiOperation(value = "删除日计划--", notes = "Api")
    private Result deleteDailyPlanXs(@RequestBody Id data){
        return productionPlanManagementService.deleteDailyPlan(data.getId());
    }

    @PostMapping("/addDailyPlan")
    @ApiOperation(value = "新增日计划--", notes = "Api")
    private Result addDailyPlan(@RequestBody AddDailyPlanReq data){
        return productionPlanManagementService.addDailyPlan(data);
    }

    @PostMapping("/addDailyPlanLt")
    @ApiOperation(value = "新增日计划络筒--", notes = "Api")
    private Result addDailyPlanLt(@RequestBody AddDailyPlanLtReq data){
        return productionPlanManagementService.addDailyPlanLt(data);
    }

    @PostMapping("/addDailyPlanQf")
    @ApiOperation(value = "新增日计划前纺--", notes = "Api")
    private Result addDailyPlanQf(@RequestBody AddDailyPlanQfReq data){
        return productionPlanManagementService.addDailyPlanQf(data);
    }

    @GetMapping("/queryPzInfo")
    @ApiOperation(value = "根据品种查锭数，定量等值，zl（定额）")
    private Result queryPzInfo(String gongxu,String pz){
        return productionPlanManagementService.queryPzInfo(gongxu,pz);
    }
}
